feature/add weixin channel#250
Closed
duguwanglong wants to merge 3 commits into
Closed
Conversation
Backend
- New WeixinChannel plugin (flocks/channel/builtin/weixin/):
- Long-poll getupdates drives inbound; AES-128-ECB CDN protocol for
image / video / file / voice media download and upload
- QR-code login flow (qr_login.py): start_qr_login / poll_qr_status
with regional redirect support
- Per-peer context_token continuity, content-addressed media cache,
message deduplication with TTL, sync_buf cursor persistence
- Default state directory: ~/.flocks/workspace/channels/weixin/
- API routes (server/routes/channel.py):
- POST /api/channel/weixin/qr-login/start
- GET /api/channel/weixin/qr-login/status
Frontend
- WeixinPanel: QR modal with polling, auto-fills token + accountId +
baseUrl on confirmed scan, auto-enables and restarts the channel
- zh-CN / en-US i18n entries for all WeChat-specific UI text
- WeChat channel icon (webui/public/channel-weixin.png)
- qrcode.react dependency for in-browser QR rendering
Fix: inbound media for non-Feishu channels
- _append_user_message (dispatcher.py) previously skipped media
attachment for any channel other than Feishu; generalised to handle
local file:// URIs (URL-decoded to support non-ASCII filenames)
produced by channel plugins that pre-download inbound media
- Add InboundMessage.media_mime so downstream consumers receive the
MIME type without re-guessing from the file extension
Co-authored-by: Cursor <cursoragent@cursor.com>
- New groupPolicy field ("all" | "disabled" | "allowlist", default "all"):
replaces the implicit always-mentioned=True workaround so group chat
handling is explicit and configurable
- New groupAllowFrom field: list of permitted group / room IDs for
allowlist mode
- _is_group_allowed() helper mirrors _is_dm_allowed() pattern
- Fix msg.mentioned: was hardcoded True for every group message which
conflated "all group messages" with "bot was @mentioned"; now False by
default — pair with groupPolicy="all" (which bypasses the dispatcher's
groupTrigger check at the channel level) for the intended behaviour
- Frontend: WeixinPanel shows groupPolicy Select + conditional
groupAllowFrom TagsInput; defaultWeixinConfig sets groupPolicy="all"
- i18n: zh-CN / en-US entries for groupPolicy, groupPolicyAll/Allowlist/
Disabled, groupAllowFrom, groupAllowFromHint, groupAllowFromPlaceholder
Co-authored-by: Cursor <cursoragent@cursor.com>
…inary group messages QR-login creates an iLink bot identity (...@im.bot) which can only receive messages via the iLink bot DM entry. Ordinary WeChat group messages are not delivered by the iLink API regardless of groupPolicy — add a startup WARNING log so users are not misled into debugging allowlists or restarts for a capability the iLink bot account type does not support. See also: NousResearch/hermes-agent#17094 Co-authored-by: Cursor <cursoragent@cursor.com>
ccf26d7 to
12c8725
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(channel/weixin): add groupPolicy config with default "all"
replaces the implicit always-mentioned=True workaround so group chat
handling is explicit and configurable
allowlist mode
conflated "all group messages" with "bot was @mentioned"; now False by
default — pair with groupPolicy="all" (which bypasses the dispatcher's
groupTrigger check at the channel level) for the intended behaviour
groupAllowFrom TagsInput; defaultWeixinConfig sets groupPolicy="all"
Disabled, groupAllowFrom, groupAllowFromHint, groupAllowFromPlaceholder